package com.jwaoo.chat.session.avchat;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;

import com.jwaoo.chat.ChatHelpter;
import com.jwaoo.chat.R;

/**
 * Created by jwaoo on 2018/1/20.
 */

public class MyDialogActivity extends Activity{

    private static Activity dialogActivity;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(AVChatDialog.getInstance().getBaseView());
        dialogActivity = this;
    }

    public static void showMyDialog(){
        Intent intent = new Intent(ChatHelpter.getContext(),MyDialogActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        ChatHelpter.getContext().startActivity(intent);
    }

    public static void closeMyDialog(){
        if (dialogActivity != null) {
            dialogActivity.finish();
            dialogActivity = null;
        }
    }
}
